package com.coocaa.x.service.liteplayer;

import android.content.ComponentName;
import android.content.Context;
import android.os.IBinder;

import com.coocaa.x.service.XServiceManager.XServiceConnection;
import com.coocaa.x.service.liteplayer.aidl.ILitePlayerKernelProxyService;

public class LitePlayerKernelServiceConnecter extends XServiceConnection<ILitePlayerKernelProxyService> {
    private static final String ACTION = "com.coocaa.x.service.liteplayerkernel2";
    private static final String CLASS_NAME = "com.coocaa.x.service.liteplayer.LitePlayerKernelService";

    public static final ComponentName getComponentName(Context context) {
        return new ComponentName(context, CLASS_NAME);
    }

    public static final LitePlayerKernelServiceConnecter connecter = new LitePlayerKernelServiceConnecter();
    private ILitePlayerKernelProxyService service = null;

    public LitePlayerKernelServiceConnecter() {
        super(ACTION);
        // TODO Auto-generated constructor stub
    }

    @Override
    protected ILitePlayerKernelProxyService _getService() {
        // TODO Auto-generated method stub
        return service;
    }

    @Override
    public void onServiceConnected(ComponentName name, IBinder s) {
        service = (ILitePlayerKernelProxyService) ILitePlayerKernelProxyService.Stub.asInterface(s);
        super.onServiceConnected(name, s);
    }

    @Override
    public void onServiceDisconnected(ComponentName name) {
        service = null;
        super.onServiceDisconnected(name);
    }
}